<?php $this->load->view('layout/header');?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <h3 class="page-title">景区退款订单审核 <small>扫码景区退款</small></h3>
            <?php echo breadcrumb(array('orderedit/index' => '景区退款订单审核')); ?>
        </div>
    </div>
    <?php echo execute_alert_message() ?>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-search"></i>搜索</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal form-search" action="<?php echo base_url('traderefund/index') ?>" method="get">
                        <div class="row-fluid">
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">退款编号</label>
                                    <div class="controls">
                                        <input type="text" class="m-wrap medium" placeholder="退款编号" name="refund_id" value="<?php echo $this->input->get('refund_id');?>">
                                    </div>
                                </div>
                            </div>
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">支付编号</label>
                                    <div class="controls">
                                        <input type="text" class="m-wrap medium" placeholder="支付编号" name="pay_id" value="<?php echo $this->input->get('pay_id');?>">
                                    </div>
                                </div>
                            </div>
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">退款状态</label>
                                    <div class="controls">
                                        <select class="medium m-wrap" name="status">
                                            <option value="">全部</option>
                                            <?php foreach ($status as $key=>$value) :?>
                                                <option value="<?php echo $key;?>" <?php if ($key == $this->input->get('status')): ?>selected="selected"<?php endif?>><?php echo $value;?></option>
                                            <?php endforeach;?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button class="btn green" type="submit">搜索</button>
                            <button class="btn reset_button_search" type="button">重置条件</button>
                        </div>
                    </form>
                </div>
            </div>

            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-reorder"></i>列表</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body flip-scroll">
                    <div class="dataTables_wrapper form-inline">
                        <?php if ($all_rows > 0) :?>
                            <table class="table table-striped table-bordered table-hover" id="sample_1">
                                <thead class="flip-content">
                                <tr>
                                    <th><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"></th>
                                    <th>编号</th>
                                    <th>支付编号</th>
                                    <th>第三方交易编号</th>
                                    <th>退款id</th>
                                    <th>总金额</th>
                                    <th>退款金额</th>
                                    <th>退款状态</th>
                                    <th>错误消息</th>
                                    <th>时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach ($page_list->result() as $item) : ?>
                                    <tr>
                                        <td><input type="checkbox" class="checkboxes" value="1" ></td>
                                        <td><?php echo $item->id;?></td>
                                        <td><?php echo $item->pay_id;?></td>
                                        <td><?php echo $item->transaction_id;?></td>
                                        <td><?php echo $item->refund_id;?></td>
                                        <td><?php echo $item->total_fee;?></td>
                                        <td><?php echo $item->refund_fee;?></td>
                                        <td>
                                            <p class="btn mini green"><?php echo $status[$item->status]; ?></p>
                                            <br>
                                            <?php if ($item->status == 1) : ?>
                                                <a href="<?php echo site_url('traderefund/refund/'.$item->id); ?>" class="btn mini blue" >申请退款</a>
                                            <?php elseif($item->status == 3) : ?>
                                                <a href="<?php echo site_url('traderefund/refund/'.$item->id); ?>" class="btn mini blue" >重新提交退款</a>
                                            <?php endif; ?>
                                        </td>
                                        <td><?php echo $item->message;?></td>
                                        <td><?php echo '创建时间：', $item->created_at, '<br/>更新时间：', $item->updated_at;?></td>
                                    </tr>
                                <?php endforeach;?>
                                </tbody>
                            </table>
                            <div class="row-fluid">
                                <div class="span6">
                                    <div class="dataTables_info">
                                        <span>当前第</span><span style="color: red"><?php echo $pg_now?></span>页
                                        <span>共</span><span style="color: red"><?php echo $all_rows?></span>条数据
                                        <span>每页显示20条 </span>
                                        <?php echo $pg_list ?>
                                    </div>
                                </div>
                            </div>
                        <?php else: ?>
                            <div class="alert"><p>未找到数据。<p></div>
                        <?php endif ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('layout/footer');?>